import os,subprocess
class KeyLib_inte(object):
    '''
    给、cmd系统关键字函数
    '''
    def check_output_del(self,path):
        '''
        使用subprocess模块check_output方法运行cmd命令
        :param path: cmd命令
        :return:
        '''
        try:
            filepath=path.split(' ')[-1]
            if os.path.exists(filepath):
                subprocess.call(path,shell=True)
                print(f'删除{filepath}成功')
            else:
                print(f'你的路径{filepath}不存在')
        except Exception as e:
            print(e)
    def call(self,path):
        '''
        使用subprocess模块cell方法运行cmd命令
        :param path: cmd命令
        :return:
        '''
        try:
            subprocess.call(path,shell=True)
            print(f'call:{path}成功')
        except Exception as e:
            print(e)

    def wait(self,timeout):
        '''
        用于暂停时间
        :param time:
        :return:
        '''
        time.sleep(int(timeout))

    def print(self,text):
        '''
        打印文字
        :param text:
        :return:
        '''
        print(text)